package com.bi.autotest.pages.payprocesspage;

import com.auto.base.PageAppium;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import org.openqa.selenium.By;
/**
 * 购买储值卡页面
 */
public class VipCardPage extends PageAppium {

    public final String ISCACHE_SUCCESSPAGE = "/html/body/div/div[1]/div/div[2]/h4";
    public final String CHECK_STORE = "我的权益";

    public final String DEPOSIT_XP = "/html/body/div/div[1]/div/div[2]/div/a[1]/div[1]";//储值余额
    public final String MY_DEPOSIT_XP = "/html/body/div/div/div[2]/a";//我要储值按钮
    public final String ADD_XP = "/html/body/div/div/div/div[2]/ul/li/div/div[2]/div[2]/a[2]";//我要储值加按钮
    public final String MOVE_XP = "/html/body/div/div/div/div[2]/ul/li/div/div[2]/div[2]/a[1]";//我要储值减按钮
    public final String PAY_BUTTON_XP = "//*[@id='btnBuy']" ;//立即支付

    public AndroidElement getPayButton() {
        return waitAutoByXp(PAY_BUTTON_XP,5);
    }

    public AndroidElement getAdd() {
        return waitAutoByXp(ADD_XP,5);
    }

    public AndroidElement getMove() {
        return waitAutoByXp(MOVE_XP,5);
    }

    public AndroidElement getDeposit() {
        return waitAutoByXp(DEPOSIT_XP,5);
    }

    public AndroidElement getMyDeposit() {
        return waitAutoByXp(MY_DEPOSIT_XP,5);
    }

    public boolean isLoginPage() {
        return isXpathExistText(By.xpath(ISCACHE_SUCCESSPAGE), CHECK_STORE, 5, false);
    }

    public VipCardPage(AndroidDriver androidDriver) {
        super(androidDriver);
    }
}
